The volume snapshot commands enable you to perform the following tasks:
To create a single Snapshot, use the volume snapshot new command and specify a virtual server name, source volume name, and Snapshot name. You can optionally specify a comment for the Snapshot.
The following example creates a Snapshot named user_anna_snap_1 of a source volume named user_anna on a virtual server named vs1:
node::>volume snapshot new -vserver vs1 -volume user_anna -snapshot user_anna_snap_1
The volume snapshot modify command enables you to change the comment associated with a Snapshot.
The following example adds a comment named "Anna's snapshot" to a Snapshot named user_anna_snap_1 of a source volume named user_anna on a virtual server named vs1.
node::>volume snapshot modify -vserver vs1 -volume user_anna -snapshot user_anna_snap_1 -comment "Anna's snapshot"
The volume snapshot show command displays the following information about Snapshots:
Virtual server name
Volume name
Snapshot name
Creation time
Size
Total number of blocks
Number of used blocks
Other information is displayed in a detailed view and if other parameters are specified. See the reference page for the command for details.
The following example displays information about all Snapshots of a volume named user_raoul:
node::>volume snapshot show -volume user_raoulBlocks Vserver Volume Snapshot CrTime Size Total Used ------------------------------------------------------------------------ vs1 user_raoul hourly_0 8AM 4 Aug 2GB 2048 1036 hourly_1 9AM 4 Aug 2GB 2048 1036
The volume snapshot promote command restores the contents of a volume from a Snapshot. You can use this feature to quickly recover lost or damaged data. The command requires the advanced privilege level or higher.
The following example restores data to a volume named src_os from a Snapshot named src_os_snap_3 on a virtual server named vs0:
node::>volume snapshot promote -vserver vs0 -volume src_os -snapshot src_os_snap_3
For information on having users restore data directly from their own Snapshots, see “Snapshot”.
NetApp recommends that you manually replicate all mirrors of a volume immediately after you promote its Snapshot. Not doing so can result in unusable mirrors that must be deleted and recreated.
To rename a Snapshot, use the volume snapshot rename command. The following example renames a Snapshot named dept_acctg_backup to dept_acctg_snap. The Snapshot is of a volume named dept_acctg on a virtual server named vs0.
node::>volume snapshot rename -vserver vs0 -volume dept_acctg -snapshot dept_acctg_backup -new-name dept_acctg_snap
To delete a Snapshot, use the volume snapshot delete command. The following example deletes a Snapshot named user_joy_snap_3 of a volume named user_joy on a virtual server named vs1.
node::>volume snapshot delete -vserver vs1 -volume user_joy -snapshot user_joy_snap_3
The volume snapshot compute-reclaimable command, which is available only at the advanced privilege level and higher, calculates the amount of disk space that can be reclaimed if specified Snapshots are deleted. This command draws heavily on computational resources on the Data ONTAP 10.0 system; using it can reduce the performance of the system for client requests and other system processes. Queries that use wildcards such as * are therefore disabled for this command. If specifying more than one Snapshot, use a comma-separated list of Snapshots with no spaces after the commas. NetApp recommends that you specify no more than three Snapshots in a single query.
The following example calculates the amount of space that can be reclaimed on a volume named dept_eng, on a virtual server named vs1, if the Snapshots named weekly.2006-01-08_0017 and daily.2006-01-09_0013 are deleted.
node::>set -priv advancednode:*gt;volume snapshot compute-reclaimable -vserver vs1 -volume dept_eng -snapshots weekly.2006-01-08_0017,daily.2006-01-09_0013
The volume snapshot policy new command creates a Snapshot policy. When applied to a volume, a Snapshot policy specifies a schedule or schedules on which Snapshots are taken and the maximum number of Snapshots that each schedule can take. A Snapshot policy can include from one to five schedules. To create schedules that can be used in Snapshot policies, use the job schedule cron new or job schedule interval new commands.
The following example creates a Snapshot policy named policy2. It runs on two schedules: a schedule named 8hrs with a maximum of three Snapshots, and a schedule named 6am with a maximum of two Snapshots. The policy is enabled.
node::>volume snapshot policy new -policy policy2 -enabled true -schedule1 8hrs -count1 3 -schedule2 6am -count2 2
The volume snapshot policy modify command enables you to modify the description associated with a Snapshot policy. The following example adds the description "For user volumes" to the Snapshot policy named policy2.
node::>volume snapshot policy modify -policy policy2 -description "For user volumes"
To display information about Snapshot policies, use the volume snapshot policy show command. The following example displays information about the Snapshot policy named policy2:
node::>volume snapshot policy show -policy policy2Number Of Is Policy Schedules Enabled Description ------------------------------------------------------------------------------ policy2 2 true For user volumes Schedule: 8hrs Count: 3 6am 2
You can add a schedule to an existing Snapshot policy by using the volume snapshot policy add-schedule command. The following example adds a schedule named halfhour with a maximum count of five Snapshots to a Snapshot policy named policy2:
node::>volume snapshot policy add-schedule -policy policy2 -schedule halfhour -count 5node::>volume snapshot policy show -policy policy2Number Of Is Policy Schedules Enabled Description ------------------------------------------------------------------------------ policy2 3 true For user volumes Schedule: 8hrs Count: 3 6am 2 halfhour 5
The volume snapshot policy modify-schedule command changes the maximum number of Snapshots for a Snapshot policy's schedule. The following example changes the maximum number of Snapshots to four for a schedule named halfhour on a Snapshot policy named policy2.
node::>volume snapshot policy modify-schedule -policy policy2 -schedule halfhour -count 4node::>volume snapshot policy show -policy policy2Number Of Is Policy Schedules Enabled Description ------------------------------------------------------------------------------ policy2 3 true For user volumes Schedule: 8hrs Count: 3 6am 2 halfhour 4
To remove a schedule from a Snapshot policy, use the volume snapshot policy remove-schedule command. The following example removes a schedule named 8hrs from a Snapshot policy named policy2.
node::>volume snapshot policy remove-schedule -policy policy2 -schedule 8hrsnode::>volume snapshot policy show -policy policy2Number Of Is Policy Schedules Enabled Description ------------------------------------------------------------------------------ policy2 2 true For user volumes Schedule: 6am Count: 2 halfhour 4
To delete a Snapshot policy, use the volume snapshot policy delete command. If you delete a Snapshot policy that is being used by one or more volumes, Snapshots of the volume or volumes are no longer taken according to the deleted policy. Before you delete a Snapshot policy, NetApp recommends that you use the volume modify command to dissociate the Snapshot policy from each volume that uses it.
The following example deletes a Snapshot policy named policy2.
node::>volume snapshot policy delete -policy policy2